package cn.cs.client;

import cn.cs.common.Page;
import cn.cs.config.CsConfiguration;
import cn.cs.fallback.AdBannerFallBack;
import cn.cs.fallback.ProductTypeFallBack;
import cn.cs.pojo.AdBanner;
import cn.cs.pojo.Product;
import cn.cs.pojo.ProductType;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * Created by yuexl
 */
@FeignClient(name = "cs-shop-provider", configuration = CsConfiguration.class, fallback = ProductTypeFallBack.class)
public interface ProductTypeClient {


    @RequestMapping(value = "/getProductTypeById", method = RequestMethod.POST)
    public ProductType getProductTypeById(@RequestParam("id") String id)throws Exception;

    @RequestMapping(value = "/getProductTypeListByMap", method = RequestMethod.POST)
    public List<ProductType> getProductTypeListByMap(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/getProductTypeListByMapPage", method = RequestMethod.POST)
    public List<ProductType> getProductTypeListByMapPage(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/getTypeTree", method = RequestMethod.POST)
    public List<ProductType> getTypeTree();

    @RequestMapping(value = "/getProductTypeCountByMap", method = RequestMethod.POST)
    public Integer getProductTypeCountByMap(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/addProductType", method = RequestMethod.POST)
    public Integer addProductType(@RequestBody ProductType productType)throws Exception;

    @RequestMapping(value = "/modifyProductType", method = RequestMethod.POST)
    public Integer modifyProductType(@RequestBody ProductType productType)throws Exception;

    @RequestMapping(value = "/deleteProductTypeById", method = RequestMethod.POST)
    public Integer deleteProductTypeById(@RequestParam("id") String id)throws Exception;

    @RequestMapping(value = "/getProTypes", method = RequestMethod.POST)
    List<Map<String,Object>> getProTypes();
    @RequestMapping(value = "/getProTypesByPid", method = RequestMethod.POST)
    List<Map<String,Object>> getProTypesByPid(@RequestParam("pid")String pid);
    @RequestMapping(value = "/getproBySales", method = RequestMethod.POST)
    List<Product> getproBySales(@RequestBody Map<String, Object> param);
    @RequestMapping(value = "/getProsBydis", method = RequestMethod.POST)
    List<Product> getProsBydis(@RequestBody Map<String, Object> param);
}

